package com.game.tank;

import com.game.tank.bean.Audio;
import com.game.tank.bean.Explode;
import com.game.tank.bean.Tank;
import com.game.tank.enums.Dir;
import com.game.tank.enums.TankGroup;
import com.game.tank.loader.PropertyMgr;

public class Main {

    public static void main(String[] args) throws InterruptedException {
        TankFrame f = new TankFrame();

        int count = PropertyMgr.getInstance().getInt("initTankCount");

        for (int i = 0; i < count; i++) {
            int x = 100 + i * 60, y = 60;
            f.tanks.add(new Tank(x,y, Dir.DOWN, TankGroup.BAD, f));
        }

        new Thread(() -> new Audio("audio/war1.wav").loop()).start();

        while (true) {
            Thread.sleep(20);
            f.repaint();

        }

    }
}
